skip navigation bar
s

Security Guard

it is a smart robot to replace human in certain places such as home, offices, server room and ensure real time monitoring and security in the environment its placed in

<firstWeek> Hardware setup </firstWeek>

Building up the smart car

before setup

installing wheels
Installing wheels on board

Installing motors on 4WD board
installing wheels on motors
connect cables to the board

installing wheels
build the head

set and customize the servo motors on bottom part and top part
install distance sensor on top part
install camera on top part
join the two parts (bottom and top)
install the head part on 4WD board
connect cables to the board

installing wheels
install raspberry pi 4 on board

set the standoffs
installing wheels on motors
content cables on board

installing wheels
install the line tracker sensor

install standoffs 10 on board
set line tracker on standoffs
content cables on board

installing wheels
connect all wires on board and pi

connect pi camera on pi port
connect distance sensor on board
content servo motors connectors on board
content batteries on board

installing wheels

after setup

installing wheels

<secondWeek> setup the raspberry pi </secondWeek>

setup raspberry pi for smart car

install libraries and enable features on raspberry pi
to be compatible for smart car components

install operating system on the pi

install OS raspbian 32
using raspberry pi Imager v1.7
update and upgrade apt packages
enable ssh, camera, I2C, Remote GPIO, and VNC connections

installing wheels
#Run the following command
# 1 to make sure that the system is uptodate
raspberry@Host:~$ sudo apt-get update && sudo apt-get upgrade
# 2 to enable interface features on pi
raspberry@Host:~$ sudo raspi-config
Install python

Installing python 3
installing Freenove_RPI_WS281x_Python library
installing python3-dev library
installing python3-pyqt5 library

installing wheels
#Run the following command
# 1 install python
raspberry@Host:~$ sudo apt-get install python python3
# 2 install dependencies
raspberry@Host:~$ sudo apt-get install -y python3-dev python3-pyqt5
# 3 clone python library from freenove for 4wd Smart car
raspberry@Host:~$ git clone https://github.com/Freenove/Freenove_RPI_WS281x_Python.git
install PyAudio for voice recognition

$ install libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev flac libraries
$ create virtual environment
$ activate the virtual environment
$ install pyaudio requests websockets using pip

installing wheels
#Run the following command
# 1 to install libraries
raspberry@Host:~$ sudo apt-get install libportaudio0 libportaudio2 libportaudiocpp0 portaudio19-dev flac # 2 create virtual environment
raspberry@Host:~$ python3 -m venv venv
# 3 activate virtual environment
raspberry@Host:~$ . venv/bin/activate
# 4 install dependencies inside the virtual environment
raspberry@Host:~$ pip install pyaudio requests websockets
setup pushing email notifications system

$ install ssmtp mailutils
$ create a gmail account for the smart car
$ create app password to allow python login and send mails
$ create a python script to send email from the smart car

smart car gmail profile
# import dependencies
import smtplib
import os
from email.message import EmailMessage
from datetime import datetime

# get current date and time
currentTime = datetime.now().strftime("%H:%M:%S")

# declare credentials for login
Email = os.environ.get('ADMIN_EMAIL')
Password = os.environ.get('ADMIN_PASSWORD')

# send message to
Receiver = "godsaveme2001@gmail.com"

# setup the server connection
mailServer = smtplib.SMTP_SSL('smtp.gmail.com', 465)

# Message
messageToSend = EmailMessage()

messageToSend['Subject'] = 'evening summary'
messageToSend['From'] = Email
messageToSend['TO'] = Receiver
messageToSend.set_content(f"This is your evening summary from smart car \n at {currentTime}all looks good!")

# check if login is successful if not print a message
try: mailServer.login(Email, Password)
except NameError as loginError:
print(f"an error occur while trying to login please check the credentials \n [{loginError}]")
# send email and if an error occurs print a message
try:
mailServer.send_message(messageToSend)
except NameError as sendMessageError:
print(f"An exception occurred \n {sendMessageError}")

print("mail has been sent successfully!")

# close connection
mailServer.quit()

<thirdWeek> code setup and testing components </thirdWeek>

Build code to test the smart car components

Test wheels motors
Test servo motors
Test LEDs
Test Buzzer
Test distance sensor
Test line tracking sensor
Test camera
Test light tracking